import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;

public class out_ {
    public static void main(String[] args) throws IOException {
        PrintStream out0=System.out;
        out0.print("xpp");
        out0.write("ccc".getBytes());
        String pathname="d:\\next0.txt";
        //输出修改成到“d:\next0.txt”
        //xxxx就会输出到该文件
        System.setOut(new PrintStream(pathname));
        System.out.println("xxxxx");
        out0.close();
    }
}
